<script type="text/javascript">
//<![CDATA[
function save() {
  $('@customer').submit();
}

//]]>
</script>
<%= form_for @customer do |f| %>
<% if @customer.errors.any? %>
<div id="error_explanation">
  <h2><%= pluralize(@customer.errors.count, "error") %> 注册商户出错啦!</h2>
  <ul>
    <% @customer.errors.full_messages.each do |msg| %>
    <li>
      <p class="error">
        <%= msg %>
      </p>
    </li>
    <% end %>
  </ul>
</div>
<% end %>
<table border="0" cellspacing="0" cellpadding="0">

  <%= f.fields_for :customer_info do |customer_info_f| %>
  <tr>
  <td>
  <%= customer_info_f.label '商户名称' %>
  </td>
  <td>
  <%= customer_info_f.text_field  :name %>
  </td>
  </tr>
  <% end %>
  <tr>
    <td><%= f.label :email %></td>
    <td><%= f.text_field :email %></td>
  </tr>
  <tr>
    <td><%= f.label :password %></td>
    <td><%= f.password_field :password %></td>
  </tr>
  <tr>
    <td><%= f.label :password_confirmation %></td>
    <td><%= f.password_field :password_confirmation %></td>
  </tr>
  <tr>
    <td align="right" colspan="2"><%= tag('button', {:class => 'button positive', :onclick => 'save();'}) %>
    <%= image_tag 'icons/tick.png' %>注册</td>
  </tr>
</table>
<% end %>
